<img src="/estadisticas/save/11" width="1" height="1">
    <script type="text/javascript" src="https://www.google.com/jsapi"></script>
    <script type="text/javascript">
      // Load the Visualization API and the piechart package.
      google.load('visualization', '1.0', {'packages':['corechart']});

      function drawProblemas() {
        // Create the data table.
        var data = new google.visualization.DataTable();
        data.addColumn('string', 'Topping');
        data.addColumn('number', 'Slices');
        data.addRows([<?php echo $datos_problemas ?>]);


        // Set chart options
        var options = {
				'width':740,
                'height':350
		};

        // Instantiate and draw our chart, passing in some options.
        var chart = new google.visualization.PieChart(document.getElementById('graph_problemas'));
        chart.draw(data, options);
      }

      function drawPracticas() {
        // Create the data table.
        var data = new google.visualization.DataTable();
        data.addColumn('string', 'Topping');
        data.addColumn('number', 'Slices');
        data.addRows([<?php echo $datos_practicas ?>]);

        // Set chart options
        var options = {
				'width':740,
                'height':350
		};

        // Instantiate and draw our chart, passing in some options.
        var chart = new google.visualization.PieChart(document.getElementById('graph_practicas'));
        chart.draw(data, options);
      }

      function drawMedicamentos() {
        // Create the data table.
        var data = new google.visualization.DataTable();
        data.addColumn('string', 'Topping');
        data.addColumn('number', 'Slices');
        data.addRows([<?php echo $datos_medicamentos ?>]);

        // Set chart options
        var options = {
				'width':740,
                'height':350
		};

        // Instantiate and draw our chart, passing in some options.
        var chart = new google.visualization.PieChart(document.getElementById('graph_medicamentos'));
        chart.draw(data, options);
      }

      function drawTurnos() {
        // Create the data table.
        var data = new google.visualization.DataTable();
        data.addColumn('string', 'Meses');
        data.addColumn('number', 'Cantidad');
        data.addRows([<?php echo $datos_turnos ?>]);

        // Set chart options
        var options = {
				'width':740,
                'height':300,
                'colors': ['#058DC7'],
				'legend': {position: 'none'},
				'vAxis': {minValue: '0'},
				'pointSize': 5
		};

        // Instantiate and draw our chart, passing in some options.
        var chart = new google.visualization.AreaChart(document.getElementById('graph_turnos'));
        chart.draw(data, options);
      }

      function drawPiramidePoblacional() {
        // Create the data table.
        var data = google.visualization.arrayToDataTable([
          ['Edades', 'Mujeres', 'Hombres'],
          <?php echo $datos_piramide ?>
        ]);

        // Set chart options
        var options = {
				'width':740,
				'isStacked':true,
				'legend': {position: 'top'},
				'chartArea': {height: '80%'},
                'colors': ['deeppink','royalblue'],
                'height':500
		};

        // Instantiate and draw our chart, passing in some options.
        var chart = new google.visualization.BarChart(document.getElementById('graph_piramide'));
        chart.draw(data, options);
      }



	jQuery(document).ready(function(){ 
		drawProblemas();
		drawPracticas();
		drawMedicamentos();
		drawTurnos();
		drawPiramidePoblacional();

        // Configuro el Tooltip
        jQuery('img').tipsy({gravity: jQuery.fn.tipsy.autoWE});
	});
    </script>	

    <script type='text/javascript' src='/js/jqprint/js/jquery.jqprint.js'></script>
    <link rel='stylesheet' href='/js/jqprint/css/style.css' type='text/css' media='all' />
    <link rel='stylesheet' href='/js/jqprint/css/print.css' type='text/css' media='print' />
    <script type='text/javascript'>
        function imprimirGrafico(div) {
            jQuery('#'+div).jqprint({
                debug: false,
                importCSS: true,
                printContainer: true,
                operaSupport: true
            });     
        }

    </script>    
<!-- start page -->

	<div id="titulo_encabezado">
		<div style="padding: 17px"><?php echo __('Estadísticas del Consultorio', true) ?>

            <div style="float: right;"><a href="#" class="btn btn-inverse" onclick="javascript:imprimirGrafico('contenedor_grafico');">
                <img src="/images/ico-print.png" style="width: 20px;" alt="Imprimir" title="Imprimir"></a>
            </div>
        </div>

		<div id="efecto-box">&nbsp;</div>
	</div>

    <div id="contenido_gral">
        <div class="cabeza_print" style="height: 50px;">
            <div style='width: 30%; float: left;'><img src='/images/logo-epicrisis2.png'></div>
            <div style="float: right; font-size: 100%; color: #000000;"><?php echo __('Estadísticas del Consultorio', true) ?></div>
        </div>


    	<div id="titulo_azul" style="margin-top: 1px;"><span><?php echo __('Problemas más frecuentes', true) ?></span></div>
    	<div id="graph_problemas" style="background: white"><img src="/images/loading3.gif"></div>

    	<div id="titulo_azul" style="margin-top: 1px;"><span><?php echo __('Prácticas más frecuentes', true) ?></span></div>
    	<div id="graph_practicas" style="background: white"><img src="/images/loading3.gif"></div>

    	<div id="titulo_azul" style="margin-top: 1px;"><span><?php echo __('Medicamentos más frecuentes', true) ?></span></div>
    	<div id="graph_medicamentos" style="background: white"><img src="/images/loading3.gif"></div>

    	<div id="titulo_azul" style="margin-top: 1px;"><span><?php echo __('Turnos (últimos 12 meses)', true) ?></span></div>
    	<div id="graph_turnos" style="background: white"><img src="/images/loading3.gif"></div>

    	<div id="titulo_azul" style="margin-top: 1px;"><span><?php echo __('Pirámide poblacional', true) ?></span></div>
    	<div id="graph_piramide" style="background: white"><img src="/images/loading3.gif"></div>
    </div>
<!-- end page -->